#pragma once

#include "Common/AtomicVal.h"
#include "Network/NetworkClient.h"

enum {
	Client_None		=	0x00,
	Client_Player	=	0x01,
	Client_Server	=	0x02,
};

namespace Network {

class TcpSlaveServer;
class GameClient
	: public NetworkClient
{
public:
	GameClient(int fd, TcpSlaveServer * s, int id);
	~GameClient();

public:
	void onRecv(UInt16 cmd, int len, void * buf);
	void onDisconnected();

public:
	void setPlayerID( UInt64 pid )	{ m_PlayerId = pid; _clientType = Client_Player; }
	void setServerID( UInt64 sid )	{ m_PlayerId = sid; _clientType = Client_Server; }
	UInt8 getClientType()	{ return _clientType; }

protected:
	UInt8 _clientType;
};

}